import X2JS from 'x2js';
import { stringToBase64_md5String } from './MD5Utils.js'
const XMLHEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';

export function json2xml_str(jsonStr) {
  let jsonObj = JSON.parse(jsonStr);
  let x2js = new X2JS();
  var xmlStr = XMLHEADER + x2js.js2xml(jsonObj, '');
  return xmlStr;
}

export function xml2json(xmlStr) {
  let x2js = new X2JS();
  return x2js.xml2js(xmlStr)
}